package com.youlu.campus.admin.community.controller;
import com.youlu.campus.admin.community.entity.ActivityAclConfig;
import com.youlu.campus.admin.community.service.ActivityAclConfigService;
import com.youlu.campus.entity.VO.req.ActivityAclConfigQueryVO;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;

@RestController
public class ActivityAclConfigController {
    @Autowired
    private ActivityAclConfigService activityAclConfigService;

    @PostMapping("/activity/acl-config/list")
    public QResult commentList(@RequestBody @NotNull ActivityAclConfigQueryVO req) {

        return QResult.success(activityAclConfigService.list(req));
    }

    @PostMapping("/activity/acl-config/create")
    public QResult create(@RequestBody @NotNull ActivityAclConfig req) {
        return QResult.success(activityAclConfigService.create(req));
    }

    @PostMapping("/activity/acl-config/update")
    public QResult update(@RequestBody @NotNull ActivityAclConfig req) {
        return QResult.success(activityAclConfigService.update(req));
    }

    @GetMapping("/activity/acl-config/find-one")
    public QResult findOne(@RequestParam("id") String id) {
        return QResult.success(activityAclConfigService.findOne(id));
    }

    @GetMapping("/activity/acl-config/delete")
    public QResult delete(@RequestParam("id") String id) {
        return QResult.success(activityAclConfigService.delete(id));
    }
}
